import pandas as pf

df = pf.read_csv("dropna.csv")
print(df)
'''
0   0   lili  18.0
1   1    tom  19.0
2   2   jack   NaN
3   3  jerry   NaN
'''

# dropna 丢弃空行
new_df = df.dropna()
print(new_df)

# 丢弃指定列
new_df = df.dropna(subset=["age"])
print(new_df)

# dropna(inplace=ture) 替换
df.dropna(inplace=True)
print(df)
